<?php

/**
 * Laravel-admin - admin builder based on Laravel.
 * @author z-song <https://github.com/z-song>
 *
 * Bootstraper for Admin.
 *
 * Here you can remove builtin form field:
 * Encore\Admin\Form::forget(['map', 'editor']);
 *
 * Or extend custom form field:
 * Encore\Admin\Form::extend('php', PHPEditor::class);
 *
 * Or require js and css assets:
 * Admin::css('/packages/prettydocs/css/styles.css');
 * Admin::js('/packages/prettydocs/js/main.js');
 *
 */

Encore\Admin\Form::forget(['map', 'editor']);
use Encore\Admin\Grid;
use Encore\Admin\Form;
use App\Admin\Extensions\Field\Tree;
use Encore\Admin\Show;
use App\Admin\Extensions\Show\MultipleFile;
use Encore\Admin\Admin;
Admin::style('.main-sidebar {overflow-y: auto !important;height: 100% !important;position: fixed;}');
Admin::js('js/jquery.form.js');
Admin::css('assets/ligntbox/css/lightbox.min.css');
Admin::js('assets/ligntbox/js/lightbox.min.js');
Admin::css('assets/DataTables/datatables.min.css');
Admin::js('assets/DataTables/datatables.min.js');

Grid::init(function (Grid $grid) {
    $grid->filter(function(Grid\Filter $filter){
        // 去掉默认的id过滤器
        $filter->disableIdFilter();
    });
});

Form::init(function (Form $form) {
    $form->disableEditingCheck();
    $form->disableCreatingCheck();
    $form->disableViewCheck();
});

Show::extend('multipleFile', MultipleFile::class);
Form::extend('tree', Tree::class);
